Shared library
A shared library is a library of executable code that is loaded in memory such that multiple executables (programs and other libraries) can use it at runtime.123
In contrast, a static library is copied into an executable. A static library can be re-used (a form of sharing) in multiple executables, but each executable contains a copy of the library code instead of sharing a copy in memory with other executables. Although not true today, historically, all libraries were static.4 Although a shared library can have static linkage, such a library is not classified as a static library.
Often, a shared library is also a dynamic library loaded by a dynamic linker, which generally makes use of the library easier for the programmer than if it instead it had static linkage. A dynamic library need not be accessible to multiple executables (shared library) and a shared library need not be loaded at consumer runtime (dynamic library).
Printed 2026-10-13.
(echo:: @ ᯤ)
Footnotes
-
Levine, John R. (2000). “9. Shared Libraries”. Linkers and Loaders. ISBN 1-55860-496-0. ↩
-
UNIX System V/386 Release 3.2 Programmers Guide, Vol. 1 (PDF). 1989. p. 8-2. ISBN 0-13-944877-2. Archived (PDF) from the original on 2025-07-31. ↩
-
“Shared Libraries in SunOS” (PDF). pp. 1, 3. Archived (PDF) from the original on 2026-01-10. ↩
-
“Difference between Static and Shared libraries”. GeeksforGeeks. 2018-10-25. Retrieved 2025-02-02. ↩